/**   
 * Copyright © 2016 公司名. All rights reserved.
 * 
 * @Title: PrivateKeyRestController.java 
 * @Prject: LianniuManager
 * @Package: com.lianniu.mgr.privateKey.controller
 * @Description: TODO
 * @author: Administrator   
 * @date: 2016年11月10日 下午4:22:34 
 * @version: V1.0   
 */
package com.lianniu.web.privateKey.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.lianniu.web.base.BaseResult;
import com.lianniu.web.privateKey.service.IPrivateKeyService;

/** 
 * @ClassName: PrivateKeyRestController 
 * @Description: 秘钥请求controller
 * @author: lzz
 * @date: 2016年11月10日 下午4:22:34  
 */
@Controller
@RequestMapping(value={"rest"})
public class PrivateKeyRestController {
    
    private final static Logger logger = Logger.getLogger(PrivateKeyRestController.class);
    @Autowired
    private IPrivateKeyService privateKeyService;
    
    
    @RequestMapping(value={"buyer/checkPrivateKey"})
    @ResponseBody
    public BaseResult checkPrivateKey(String supplyId,String card){
        logger.info("checkPrivateKey begin.");
        logger.info("checkPrivateKey checkPrivateKey begin.");
        logger.info("checkPrivateKey checkPrivateKey param supplyId:["+supplyId+"],card:["+card+"]");
        BaseResult result = privateKeyService.checkPrivateKey(supplyId, card);
        logger.info("checkPrivateKey checkPrivateKey end.");
        return result;
    }
    
    @RequestMapping(value={"buyer/checkSupplyKey"})
    @ResponseBody
    public BaseResult checkSupplyKey(String userId){
        logger.info("checkSupplyKey begin.");
        logger.info("checkSupplyKey checkSupplyKey begin.");
        logger.info("checkSupplyKey checkSupplyKey param userId:["+userId+"]");
        BaseResult result = privateKeyService.checkSupplyKey(userId);
        logger.info("checkSupplyKey checkSupplyKey end.");
        return result;
    }
}
